package com.example.administrator.himalaya.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.administrator.himalaya.R;
import com.example.administrator.himalaya.entity.categoryentity.ProgramEntity;

import java.util.Collection;


/**
 * Created by Administrator on 2016/12/12.
 */

public class ProgramAdapter extends RecyclerView.Adapter<ProgramAdapter.ViewHolder>{
    private Context context;
    private ProgramEntity.DatasEntity datasEntity;
    private String intro;

    public ProgramAdapter(Context context, ProgramEntity.DatasEntity datasEntity) {
        this.context = context;
        this.datasEntity = datasEntity;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new ViewHolder(LayoutInflater.from(context).inflate(R.layout.program_item,parent,false));
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
    }

    public void addAll(ProgramEntity.DatasEntity collection){
//        int size = list.size();
//        list.addAll(collection);
//        //添加一组数据
//        notifyItemRangeInserted(size, collection.size());
        intro = collection.getDetails().getIntro();


    }

    @Override
    public int getItemCount() {
        return 0;
    }

    public static class ViewHolder extends RecyclerView.ViewHolder{
        private TextView textView;
        public ViewHolder(View itemView) {
            super(itemView);
            textView =(TextView)itemView.findViewById(R.id.tv_program_item1);
        }
    }
}
